/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.yandex.skipass;

import java.util.Calendar;

/**
 *
 * @author Brothers
 */
public class PassNumberLift extends SkiPass {

    private int numberLift;

    public PassNumberLift(int idPass, Enums.PassType typePass,
            Calendar firstDatePass, Enums.Week ogrPass) {
        super(idPass, typePass, firstDatePass, ogrPass);
        this.numberLift = 0;

    }

    public int getNumberLift() {
        return this.numberLift;
    }

    protected void setNumberLift(int i) {
        this.numberLift = Enums.LiftEnum.values()[i].getEnum();
    }

    public boolean isPassForSeasonRight(AccountingSystem sys, int id) {
        if (((PassNumberLift) this).getNumberLift() == 0) {
            this.blockPass();
            ((Turnstile) sys.getTurn().get(id)).plusAccessFalse();
            return false;
        } else {
            return true;
        }
    }
}
